home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / trueSpace 7.6 / tS761B8Std.exe / {app} / Scripts / MaterialEditor / BricksHidden / Attenuation.Brick.xml next >
Extensible Markup Language  |  2008-06-10  |  1KB  |  17 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <ME_BRICK GUID="{BA530DE1-4BB3-4241-BE4A-4A323A903979}" Name="RtUAttenuation" GUIName="Attenuation" Description="Attenuation computation">
  3.     <ME_BRICK_INPUTPARAM GUID="{326DA0F5-434B-4FFC-803C-2F66B15CDA0F}" Name="Constant" Type="RtFloat"/>
  4.     <ME_BRICK_INPUTPARAM GUID="{35045B24-4132-45AF-A572-5326792B8CB6}" Name="Linear" Type="RtFloat"/>
  5.     <ME_BRICK_INPUTPARAM GUID="{23A30651-4ED9-484D-9859-13E962BC8B50}" Name="Cubic" Type="RtFloat"/>
  6.     <ME_BRICK_INPUTPARAM GUID="{A77FE343-57D8-4F52-BAEC-E2EC6B5D1A42}" Name="Distance" Type="RtFloat"/>
  7.     <ME_BRICK_OUTPUTPARAM GUID="{61797E83-8B7F-4C70-A7C5-986EDFDA0ED1}" Name="FinalIntensity" Type="RtFloat"/>
  8.     <ME_BRICK_CODE><![CDATA[
  9.     //The attenuation parameter
  10.     void RtUAttenuation(in RtFloat Constant, in RtFloat Linear, in RtFloat Cubic,  in RtFloat Distance, out RtFloat FinalIntensity)
  11.     {
  12.         RtFloat fAdd = rtx_Dot(RtFloat3(Constant, Linear, Cubic), RtFloat3(1.0f, Distance, Distance * Distance));
  13.         FinalIntensity = (fAdd <= 0) ? 1.0f : 1.0f / fAdd;
  14.     }
  15.     ]]></ME_BRICK_CODE>
  16. </ME_BRICK>
  17.